package com.ymttest.database.sqlwapper.hunter;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.hunter.SumHunterSaleAmount;

public class SumHunterSaleAmountWrapper {
	
	SqlManager manager;

    public SumHunterSaleAmountWrapper() {
        manager = new SqlManager("tradingsettlement");
    }
    
    @SuppressWarnings("unchecked")
	public SumHunterSaleAmount selectByHunterId(Long hunterId) {
    	
    	SumHunterSaleAmount sumHunterSaleAmount = new SumHunterSaleAmount();
    	
    	List<SumHunterSaleAmount> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.hunter.SumHunterSaleAmountMapper.selectByHunterId",
                        hunterId);
        manager.commit();
        
        if (result.size() > 0)
        	sumHunterSaleAmount = result.get(0);
        
        return sumHunterSaleAmount;
    }
    
    public static void main(String[] args) {
    	SumHunterSaleAmountWrapper test = new SumHunterSaleAmountWrapper();
    	
    	System.out.println(test.selectByHunterId(1022L).getSale_amount());
    }
}
